import 'package:flutter/material.dart';
import 'package:moose_app/ui/values/values.dart';
import 'package:moose_app/ui/widgets/icons/search_icon.dart';

class ATHSearchInput extends StatelessWidget {
  final String hintText;
  final ValueChanged<String> onChanged;
  final TextEditingController controller;
  final Function onTap;
  final bool enabled;

  const ATHSearchInput(
      {Key key,
      this.hintText = "搜索",
      this.controller,
      this.onChanged,
      this.onTap,
      this.enabled})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(kSize8),
        ),
        child: TextField(
          onChanged: onChanged,
          onTap: onTap,
          controller: controller,
          enabled: enabled,
          cursorColor: kColor99,
          decoration: InputDecoration(
            isDense: true,
            icon: Container(
              margin: EdgeInsets.only(left: kSize12),
              child: ATHSearchIcon(),
            ),
            hintText: hintText,
            border: InputBorder.none,
          ),
        ));
  }
}
